package Java7_Concurrency_Cookbook.thread_synchronized_base.read_write_lock;

public class Reader implements Runnable {

    private PricesInfo pricesInfo;

    public Reader(PricesInfo pricesInfo) {
        this.pricesInfo = pricesInfo;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            String tName = Thread.currentThread().getName();
            System.out.println(tName + " : Price 1 : " + pricesInfo.getPrice1());
            System.out.println(tName + " : Price 2 : " + pricesInfo.getPrice2());
        }
    }
}
